package com.zwj.controller;


import com.zwj.bo.BatchBo;
import com.zwj.bo.CourseIndustryBo;
import com.zwj.dto.Result;
import com.zwj.entity.CourseIndustryEntity;
import com.zwj.service.BatchService;
import com.zwj.service.CourseIndustryService;
import com.zwj.utils.TokenUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zqb
 * @since 2021-11-05
 */
@Api(value = "行业管理",tags="行业管理")
@RestController
@RequestMapping("/course-industry-entity")
public class CourseIndustryController {
    private final CourseIndustryService courseIndustryService;

    public CourseIndustryController(CourseIndustryService courseIndustryService) {
        this.courseIndustryService = courseIndustryService;
    }

    @ApiOperation(value = "查询行业", notes = "条件行业")
    @PostMapping("/selectIndustry")
    public Result selectIndustry(@RequestBody CourseIndustryBo courseIndustryBo) {
        return courseIndustryService.selectIndustry(courseIndustryBo);
    }

    @ApiOperation(value = "添加行业", notes = "添加行业")
    @PostMapping("/addIndustry")
    public Result addIndustry(@RequestBody CourseIndustryEntity courseIndustryEntity) {
        return courseIndustryService.addIndustry(courseIndustryEntity);
    }

    @ApiOperation(value = "修改行业", notes = "修改行业")
    @PostMapping("/updateIndustry")
    public Result updateIndustry(@RequestBody CourseIndustryEntity courseIndustryEntity) {
        return courseIndustryService.updateIndustry(courseIndustryEntity);
    }

    @ApiOperation(value = "删除行业", notes = "删除行业")
    @PostMapping("/deleteIndustry")
    public Result deleteIndustry(@RequestBody CourseIndustryEntity courseIndustryEntity) {
        return courseIndustryService.deleteIndustry(courseIndustryEntity);
    }

    @ApiOperation(value = "修改行业状态", notes = "修改行业状态")
    @PostMapping("/updateIndustryStatus")
    public Result updateIndustryStatus(@RequestBody CourseIndustryEntity courseIndustryEntity) {
        return courseIndustryService.updateStatus(courseIndustryEntity);
    }
}

